﻿
@using KRM.Core.Library
@model KRM.Core.tblTicket
<form></form>
<form action="/EmailTicket/AddTask" id="frAddTask" method="POST" class="form-horizontal"style="margin:0">
    @Html.ValidationSummary(true)
    <input type="hidden" name="AssignedByUser" id="UserID" value="@Users.Current(User.Identity.Name).UserID"/>    
    <input type="hidden" name="ticketId" id="ticketId" value="@Model.TicketID"/>   
        <input type="hidden" name="originalEmailID" id="originalEmailID" value="@Model.OriginalEmailID"/>   

    <div class="modal-header">
         <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
         <h4> Create Task</h4>
    </div>    
    <div class="modal-body form-horizontal" style="padding-bottom: 0px;">
         <div class="row">
             <div class="col-md-12" id="msg-frAddTask">
             </div>
         </div>
            <div class="form-group">
                <label  class="col-md-2 control-label">Task type</label>
                <div class="col-md-10">
                    @Html.DropDownList("TaskTypeID",null,new {@class="form-control", @onchange="gettitles(this.value)"})
                </div>
            </div> 
                            
            <div class="form-group">
                <label  class="col-md-2 control-label">Task title</label>
                <div class="col-md-10">
                    @Html.DropDownList("TaskTitleID", null, new { @class = "form-control", @onchange="ClearAlert()" })
                </div>
            </div>

            <div class="form-group">
                <label  class="col-md-2 control-label">Reason</label>
                <div class="col-md-10">
                    <select  class="form-control" name="reason" id="ReasonID">
                        <option value="0">--Select a title--</option>
                        <option value="Customer Change Of Circumstances">Customer Change Of Circumstances</option>
                        <option value="Damaged">Damaged</option>
                        <option value="Incorrect">Incorrect</option>
                        <option value="Missing">Missing</option>
                        <option value="Other">Other</option>
                    </select>
                </div>
            </div>
                            
            <div class="form-group">
                <label  class="col-md-2 control-label">Description</label>
                <div class="col-md-10">
                    <textarea class="form-control" rows="4" id ="TaskDescription" name ="TaskDescription">@ViewBag.Description 
                                  </textarea>
                </div>
            </div>
            <div class="form-group">
                <label  class="col-md-2 control-label">Assign to user</label>
                <div class="col-md-10">
                    @Html.DropDownList("AssignedToUser",null,new {@class="form-control",@onchange="ClearAlert()"})
                </div>
            </div>
        <div class="form-group" >
            <label  class="col-md-2 control-label">OrderRef</label>
            <div class="col-md-4" id="groupOrderRef">
                <div class="input-icon right">
                    <i id="icoGroupOrderRef" class="" data-toggle="tooltip" data-placement="top" title="OrderRef"></i>
                    <input type="text" id="OrderRef" name="OrderRef" class="form-control" required="required" placeholder="Enter OrderRef" value="@ViewBag.OrderRef" onchange="ClearAlert()">
                </div>
            </div>
            <label  class="col-md-2 control-label">Complete by</label>
                <div class="col-md-4">
                    <div id ="datetimepicker1"class="input-group date">                                       
                        <input  type="text" name="CompleteByDate" class="form-control"value="@DateTime.Now.AddHours(1).ToString("MM/dd/yyyy HH:mm")"placeholder="mm/dd/yyyy hh:mm" required="required"/>
                        <span class="input-group-btn">
                            <button class="btn default date-set" type="button"><i class="icon-calendar"></i></button>
                        </span>
                    </div>

                </div>
                @*<label  class="col-md-1 control-label">Hrs:</label>
                <div class="col-md-2">
                    <select name="CompleteByHrs"id="CompleteByHrs"class="form-control">
                        <option value="00"></option>
                        <option value="18">18</option>
                        <option value="17">17</option>
                        <option value="16">16</option>
                        <option value="15">15</option>
                        <option value="14">14</option>
                        <option value="13">13</option>
                        <option value="12">12</option>
                        <option value="11">11</option>
                        <option value="10">10</option>
                        <option value="09">9</option>
                        <option value="08">8</option>
                    </select>
                </div>
                <label  class="col-md-1 control-label">Mins:</label>
                <div class="col-md-2">
                    <select name="CompleteByMins" class="form-control">
                        <option value="00">00</option>
                        <option value="15">15</option>
                        <option value="30">30</option>
                        <option value="45">45</option>
                    </select>
                </div>*@
        </div>      
            <div class="form-group">
                <label  class="col-md-2 control-label">Duration</label>
                <div class="col-md-4">
                    @Html.DropDownList("DurationID",null,new {@class="form-control"})
                </div>
                <label  class="col-md-2 control-label">Priority</label>
                <div class="col-md-4">
                    @Html.DropDownList("PriorityID",null,new {@class="form-control"})
                </div>
            </div>

        
    </div>
    <div class="modal-footer">        
        <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>        
        <button type="submit" id="btnAccept" class="btn blue">Create</button>
    </div></form>

